#include "windowfactory.h"
#include "childwindowbase.h"

WindowFactory::WindowFactory(QWidget *parent) :
    QFrame(parent)
	,m_MainLayout(new QHBoxLayout)
	,m_ChildWindow(new ChildWindowBase)
{
	setLayout(m_MainLayout);
}

WindowFactory* WindowFactory::instance()
{
	static WindowFactory *m_WindowFactory = new WindowFactory;
	return m_WindowFactory;
}

void WindowFactory::updateWindow(ChildWindowBase *childWindow)
{
	delete m_ChildWindow;
	m_MainLayout->addWidget(childWindow);
	m_ChildWindow = childWindow;
}

void WindowFactory::updateGroupView(int groupId)
{
	m_ChildWindow->showGroupView(groupId);
}
